<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html;charset=UTF-8"/>
    <title>登录</title>
    <link rel="stylesheet" th:href="@{css/bootstrap.min.css}"/>
    <style type="text/css">
        body { padding: 20px; }
        .starter-template { width:350px; padding: 0 40px; text-align: center; }
    </style>
</head>
<body>
<p>
    <a th:href="@{/index}"> INDEX</a>
    <a th:href="@{/admin}"> | ADMIN</a>
    <a th:href="@{/hello}"> | HELLO</a>
    <br/>
</p>
<hr/>
<div class="starter-template">
    <p th:if="${param.logout}" class="bg-warning">已成功注销</p><!-- 1 -->
    <p th:if="${param.error}" class="bg-danger">有错误，请重试</p> <!-- 2 -->
    <h2>使用用户名密码登录</h2>
    <form name="form" th:action="@{/login}" action="/login" method="POST"> <!-- 3 -->
        <div class="form-group">
            <label for="username">账号</label>
            <input type="text" class="form-control" name="username" value="" placeholder="账号" />
        </div>
        <div class="form-group">
            <label for="password">密码</label>
            <input type="password" class="form-control" name="password" placeholder="密码" />
        </div>
        <div class="form-group">
            <input type="submit" id="login" value="登录" class="btn btn-primary" />
        </div>

    </form>
</div>
</body>
</html>